<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<c:set var="ctxStatic" value="${pageContext.request.contextPath}/static" />
<!DOCTYPE html>
<html> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" > 
    <title>点赞</title> 
    <meta name="viewport" content="height = device-height, width=device-width, initial-scale=1, user-scalable=no">
    <link href="${ctxStatic}/jqmobile/jquery.mobile-1.4.3/jquery.mobile-1.4.3.min.css" rel="stylesheet"> 
    	<link rel="stylesheet" href="${ctxStatic}/kaka/css/ui-base.css">
        <link rel="stylesheet" href="${ctxStatic}/kaka/css/ui-box.css">
        <link rel="stylesheet" href="${ctxStatic}/kaka/css/ui-color.css">
		<link rel="stylesheet" href="${ctxStatic}/kaka/css/ui-res.css">
		<link rel="stylesheet" href="${ctxStatic}/kaka/css/ui-style.css">
		<link rel="stylesheet" href="${ctxStatic}/kaka/css/layout.css">
    
	<script src="${ctxStatic}/jquery/1.11.1/jquery-1.11.1.min.js"></script>
	<script src="${ctxStatic}/jqmobile/jquery.mobile-1.4.3/jquery.mobile-1.4.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){	
	var check = $("#cp").val();
	if(parseInt($("#ppc").val())>=parseInt($("#ptc").val())){
	$.mobile.loading( 'show', {
		  text: "您当前可领取"+check+"个卡点，请及时认领卡点，或系统将在凌晨为您自动认领。",
		  textVisible: true,
		  theme: 'b',
		  textonly: true,
		  html: ""
		  });		
	setTimeout("hide()",5000);	
	}
	var message = $("#message").val();
	if(message!=""){
		$.mobile.loading( 'show', {
			  text: message,
			  textVisible: true,
			  theme: 'b',
			  textonly: true,
			  html: ""
			  });		
		setTimeout("hide()",5000);	
	}
});
function hide(){
	$.mobile.loading( "hide" );
}
</script>
</head>
<body class="um-vp bg-gray" ontouchstart>
<div data-role="page" data-theme="none">
        <div id="page_0" class="up ub ub-ver " tabindex="0">
            <!--header开始-->
            <div id="header" class="uh c-m3 t-wh headerbg">
                <h1 class="hbg ulev0 ut-s tx-c headerPo" tabindex="0"><a class="btnBack" href="${ctx}/shopIndex/${shopid}-${openid}" data-ajax="false"></a><span   id="headtitle">${shop.shop_name}</span><a href="" class="textReport"></a></h1>
            </div>
			<!--content开始-->
            <div id="content" class="contentC">
			    <div class="shopView borderBottom">
                	<a href="">
                	<c:choose>
                	<c:when test="${shop.head_image eq null or shop.head_image eq '无'}">
                	<div class="shopPic"><img src="${ctx}/images/logo_kaka.png"></div>
                	</c:when>
                	<c:otherwise>
                		<div class="shopPic"><img src="${serverUrl}${shop.head_image}"></div>
                		</c:otherwise>
                	</c:choose>	
						<div class="shopInfo">
							<ul class="infoList">
								<li class="tittle">${shop.shop_name}<c:if test="${shop.shop_name eq null}">无</c:if></li>
								<li class="text_info">${shop.address}<c:if test="${shop.address eq null}">无</c:if></li>
							</ul>
							
						</div></a>
                </div>
				<div class="shareBar">
						<span class="iconPraiseB"></span><span class="textS"> 点赞${praise.total_count}<c:if test="${praise.total_count eq null}">0</c:if>次，获赠${praise.presenter_count}<c:if test="${praise.presenter_count eq null}">0</c:if>个卡点</span>
					</div>
					<input type="hidden" value="${us.point_praise_count}" id="ppc">
					<input type="hidden" value="${praise.total_count}" id="ptc">
					<input type="hidden" value="${check}" id="cp">
					<input type="hidden" value="${message}" id="message">
					<c:if test="${us.point_praise_count ne null}">
					<c:if test="${us.point_praise_count eq praise.total_count or us.point_praise_count gt praise.total_count}">
					<div class="claimBox">
						<span class="textC">您有<span class="textKa">${check}</span>个卡点可以认领</span><a class="btnClaim" href="${ctx}/takePraisePoint/${shopid}-${openid}" data-ajax="false">认领</a>
					</div>
					</c:if>
					</c:if>
					<div class="clear10"></div>
					<div class="heapBox">已累积<span class="textBlueKa">${us.point_praise_count}<c:if test="${us.point_praise_count eq null}">0</c:if></span><span class="textGray">/${praise.total_count}<c:if test="${praise.total_count eq null}">0</c:if></span>个点赞</div>
					<p class="heapLine">每天最多可以点赞${praise.day_count}<c:if test="${praise.day_count eq null}">0</c:if>次，您今天已点赞${us.day_praise_count}<c:if test="${us.day_praise_count eq null}">0</c:if>次。</p>
					<p class="heapLine" style="color: red;"><c:if test="${praise eq null && praise.day_count eq null}">店家未设置点赞功能</c:if></p>
				<div class="btnArea">
					<c:if test="${praise ne null && praise.day_count ne null}"><a class="btnShare" href="${ctx}/searchPraise1/${shopid}-${openid}" data-ajax="false">点&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;赞</a></c:if>
				</div>
            </div>
            <!--content结束-->
			<!--footer开始-->
            <div id="footer" class="uf c-m2 c-bla t-wh">
            </div>
            <!--footer结束-->
        </div>

</div>
</body> 
</html>
